function chitiet_sp(d, i, t) {
		var n = d.substring(7);
		d = document.getElementById(d);
		var e = "", a = d.getElementsByTagName("img");
		1 <= a.length && (e = '<img src="'+a[0].src+'"/>');
		var s = d.innerHTML.substring(d.innerHTML.indexOf("[tomtat]") + 8,
				d.innerHTML.indexOf("[/tomtat]")), _ = d.innerHTML.substring(
				d.innerHTML.indexOf("[giaban]") + 8, d.innerHTML
						.indexOf("[/giaban]")), 
						x = d.innerHTML.indexOf("[/giaban]");
		if (d.innerHTML.indexOf("[tintuc]") != -1 || d.innerHTML.indexOf("[video]") != -1) 
		{
//mo_ta = d.innerHTML.substring(d.innerHTML.indexOf("[mota]") + 6 , d.innerHTML.indexOf("[/mota]"));
			noi_dung = d.innerHTML.substring(d.innerHTML.indexOf("[noidung]") + 9 , d.innerHTML.indexOf("[/noidung]"));			
			d.innerHTML = '<div class="tintuc"><h1  class="title_tin">' + i
					+ '</h1><div class="noidungtin">' + noi_dung + "<div></div>"
		} else
					tintuc = d.innerHTML.substring(d.innerHTML
							.indexOf("[tintuc]") + 8, d.innerHTML
							.indexOf("[/tintuc]")),
					kythuat = -1 != d.innerHTML.indexOf("[kythuat]") ? d.innerHTML
							.substring(d.innerHTML.indexOf("[kythuat]") + 9,
									d.innerHTML.indexOf("[/kythuat]"))
							: "",
					mota = -1 != d.innerHTML.indexOf("[mota]") ? d.innerHTML
							.substring(d.innerHTML.indexOf("[mota]") + 6,
									d.innerHTML.indexOf("[/mota]")) : "",
					hinhanh = -1 != d.innerHTML.indexOf("[mota]") ? d.innerHTML
							.substring(d.innerHTML.indexOf("[hinhanh]") + 9,
									d.innerHTML.indexOf("[/hinhanh]")) : "",
					d.innerHTML = -1 != d.innerHTML.indexOf("[tintuc]") ? '<div class="tintuc"><h2 class="newstitle"><a href="'+t+'">'
							+ i
							+ "</a></h2><p>"
							+ tintuc
							+ '</p><div class="clear"></div>'
							: '<div class="w-detail group simpleCart_shelfItem"><div id="img_'+n+'" class="large-6 medium-6 column"><a imageanchor="1" class="th" href="'+a[0].src+'">'
									+ e
									+ ' </a><div class="addthis_toolbox addthis_default_style "><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div></div><div class="large-6 medium-6 column"><div class="title item_name">'
									+ i
									+ '</div><div class="w-giaban">Giá Bán: <b class="item_price">'
									+ _
									+ "</b></div>"
									+ s
									+ '<br/><br/><div class="boxbuy"><div class="soluong"><input type="number" name="quantity" min="1" max="100" value="1" class="item_quantity"></div><div class="btnMore"><a title ="" target="_blank" href="javascript:void(0);" class="item_add addtocart" rel="'
									+ n
									+ '">Đặt Hàng</a></div></div></div><div class="clear"></div><div id="horizontalTab" class="r-tabs"><div class="tab-side r-tabs-nav"><div class="r-tabs-state-default r-tabs-tab"><a class="active" href="#tab-1">Chi tiáº¿t sáº£n pháº©m</a></div></div><div class="tabs-container">'
									+ kythuat + "</div></div></div>"
	}
function tintuc(e) {
		j = showRandomImg ? Math.floor((imgr.length + 1) * Math.random()) : 0;
		img = [];
		var kk =0;
		for ( var t = 0; t < labelnumposts; t++) {
			var n = e.feed.entry[t], r = n.title.$t, i;
			if (t == e.feed.entry.length)
				break;
			for ( var o = 0; o < n.link.length; o++)
				if ("alternate" == n.link[o].rel) {
					i = n.link[o].href;
					break
				}
			for (o = 0; o < n.link.length; o++)
				if ("replies" == n.link[o].rel && "text/html" == n.link[o].type) {
					n.link[o].title.split(" ");
					break
				}
			o = "content" in n ? n.content.$t : "summary" in n ? n.summary.$t : "";
			mota = o.substring(o.indexOf("[mota]") + 6,o.indexOf("[/mota]"))
			//var res = o.split('more');			
			postdate = n.published.$t;
			var author = n["author"][0]["name"]["$t"];
			var date = new Date(postdate.substring(0, 10));
			var ngaydang = date.toLocaleDateString("vi-VN");
			j > imgr.length - 1 && (j = 0);
			img[t] = imgr[j];
			s = o;
			a = s.indexOf("<img");
			b = s.indexOf('src="', a);
			c = s.indexOf('"', b + 5);
			d = s.substr(b + 5, c - b - 5);
			-1 != a && -1 != b && -1 != c && "" != d && (img[t] = d);
			n = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
			postdate.split("-")[2].substring(0, 2);
			o = postdate.split("-")[1];
			postdate.split("-");
			for ( var u = 0; u < n.length && parseInt(o) != n[u]; u++)
				;
	      if(kk == 0){
			
			//tomtat = res[0].substring(0,res[0].length - 9);
			r = '<div class="box_big group"><div class="big_img"><a href="' + i + '"><img alt="" src="'
						+ img[t]
						+ '" /></a></div><h2 class="big_title"><a href="' + i + '">'
						+ removeHtmlTag(r, labelsumtitle)
						+ '</a></h2><div class="big_desc">'
						+ mota + '</div></div>';
			document.write(r);
			kk=1;
	      }else{

		  	r = '<li class="group"><div class="thumb_news"><img alt="" src="'
						+ img[t]
						+ '" /></div><div class="title_news"><h3><a href="' + i + '">'
						+ removeHtmlTag(r, labelsumtitle)
						+ '</a></h3><span class="recent-date">' + ngaydang + '</span><span class="recent-author">' + author + '</span></div></li>';
			document.write(r);
		  }
		  j++
		}
	}function rgt_news(i){j=showRandomImg?Math.floor((imgr.length+1)*Math.random()):0,img=new Array,maxpost=numposts<=i.feed.entry.length?numposts:i.feed.entry.length;for(var t=0;t<maxpost;t++){var n,e,_=i.feed.entry[t],x=_.title.$t;if(t==i.feed.entry.length)break;for(var r=0;r<_.link.length;r++)if("alternate"==_.link[r].rel){e=_.link[r].href;break}for(var r=0;r<_.link.length;r++)if("replies"==_.link[r].rel&&"text/html"==_.link[r].type){n=_.link[r].title.split(" ")[0];break}if("content"in _)var l=_.content.$t;else if("summary"in _)var l=_.summary.$t;else var l="";if(j>imgr.length-1&&(j=0),img[t]=imgr[j],s=l,a=s.indexOf("<img"),b=s.indexOf('src="',a),c=s.indexOf('"',b+5),d=s.substr(b+5,c-b-5),-1!=a&&-1!=b&&-1!=c&&""!=d&&(img[t]=d),t>=0&&10>=t){var o='<div class="item_block group"><div class="b_thumb"><a href="'+e+'" title="'+x+'"><img src="'+img[t]+'"/></a></div><div class="b_info"><a href="'+e+'" title="'+x+'">'+x+'</a><div class="n-desc">'+removeHtmlTag(l.substring(l.indexOf("[tintuc]")+8,l.indexOf("[/tintuc]")),150)+"...</div></div></div>";